package org.cerberus.platform.internal.server.jetty;

import java.util.Map;

import org.cerberus.platform.internal.IObjectGraphTransaction;
import org.cerberus.platform.internal.server.IPlatformServer;
import org.mortbay.jetty.Server;

public class JettyServer implements IPlatformServer {

	private Server jetty;
	
	@Override
	public IObjectGraphTransaction createTransaction(Integer platformID) {
		return null;
	}

	@Override
	public void start(Map<String, String> parameters) {
		jetty = new Server(8081);
		jetty.addHandler(new JettyHandler(this));
	}

	@Override
	public void stop() {
		try {
			jetty.stop();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
